'use strict';
function get_integer_interval(number_a, number_b) {
  let result=[];
  if(number_a<number_b){
    for(let num=number_a;num<=number_b;num++){
      result.push(num);
    }
  }
  else if(number_a>number_b){
    for(let num=number_a;num>=number_b;num--){
      result.push(num);
    }
  }
  else{
    result.push(number_a);
  }
  return result;
}


function make_num_into_letter(collection){
  let result=[];
  for(let item of collection){
    let num1=item%26;
    let num2=Math.floor(item/26);
    if(num2==0){
      result.push(String.fromCharCode(num1+96));
    }
    else if(num2==1&&num1==0){
      result.push(String.fromCharCode(122));
    }
    else if(num2>1&&num1==0){
      result.push(String.fromCharCode(num2-1+96,122))
    }
    else{
      result.push(String.fromCharCode(num2+96,num1+96))
    }
  }
  return result;
}


function get_letter_interval_2(number_a, number_b) {
  let result;
  result=get_integer_interval(number_a,number_b);
  result=make_num_into_letter(result);
  console.log(result);
  return result;

}

module.exports = get_letter_interval_2;
get_letter_interval_2(53,20);

